

<include file="public@header" />
</head>
<body>
<div class="wrap js-check-wrap">

    <form class="well form-inline margin-top-20" method="get" >

        用户名:
        <input type="text" class="form-control" id="name" style="width: 120px;"  placeholder="请输入用户名">

        时间:
        <input type="text" class="form-control js-bootstrap-datetime" id="start_time" style="width: 140px;" autocomplete="off">
        ~
        <input type="text" class="form-control js-bootstrap-datetime" id="end_time" style="width: 140px;" autocomplete="off">

        类型:
        <select class="form-control" name="category" id="status" style="width: 140px;">
            <option value='-1'>全部</option>
            <option value='1'>收入</option>
            <option value='0'>支出</option>
            <option value='2'>充值积分</option>
            <option value='3'>赠送积分</option>
        </select> &nbsp;&nbsp;

        <input type="button" id="selectval" class="btn btn-primary" value="搜索" />


        <a class="btn btn-danger" href="{:url('index')}">清空</a>
    </form>

    <table class="table table-hover table-bordered">

        <table class="layui-hide" id="test" lay-filter="test"></table>

        <script type="text/html" id="toolbarDemo">
            <div class="layui-btn-container">
                <button class="layui-btn layui-btn-sm" id="allscore"></button>

            </div>
        </script>
        <script type="text/html" id="barDemo">
<!--            <a class="layui-btn layui-btn-xs" lay-event="edit">编辑</a>-->
<!--            <a class="layui-btn layui-btn-danger layui-btn-xs" lay-event="del">删除</a>-->
        </script>

        <!--    自定义    -->
        <script type="text/html" id="titleTpl">
            {{#  if(d.id < 2){ }}
            小于1
            {{#  } else { }}
            大于1
            {{#  } }}
        </script>


        <script>



            layui.use('table', function(){
                var table = layui.table;
                var curl="{:url('index')}";

                var tableIns =table.render({
                    elem: '#test' ,
                    url:curl,
                    method: 'post',
                    toolbar: '#toolbarDemo',
                    title: '用户数据表',
                    totalRow: true ,
                    limit:100,
                    limits:[100,500,999],
                    cols: [[

                        {field:'id', title:'ID', width:80, fixed: 'left', unresize: true, sort: true, totalRowText: '合计'}
                        ,{field:'user_nickname', title:'用户名',edit: 'text'}
                        ,{field:'mobile', title:'电话'}
                        ,{field:'score', title:'积分', sort: true, totalRow: true}
                        ,{field:'before', title:'变更前'}
                        ,{field:'after', title:'变更后'}
                        ,{field:'action', title:'备注'}
                        ,{field:'create_time', title:'操作时间'}

                    ]]
                    ,page: true,
                    done: function(res, curr, count){

                        console.log(res);

                        $("#allscore").html(res.msg)
                    }
                });


                $("#selectval").click(function (){

                    var status=$("#status").val();
                    var name=$("#name").val();
                    var start_time=$("#start_time").val();
                    var end_time=$("#end_time").val();
                    tableIns.reload({
                        where: { status: status,name:name,starttime:start_time,endtime:end_time} ,
                        page: { curr: 1  }
                    });

                })





            });
        </script>


    </table>

</div>
<script src="__STATIC__/js/admin.js"></script>
</body>
</html>